<?php
namespace Mobile\Controller;
class IndexController extends PublicController {
    public function index(){
        $this->getip();
        $this->baike();
        $this->biao();
        $this->company();
        $this->demo();
        $this->style();
    	$this->list();
        $this->huxing();
        $this->zxwd();
        $this->show();
    }
   
    function style(){
        $styleOb = M("M_style");
        $sarr = $styleOb->limit(4)->select();
        $this->assign('sarr',$sarr);
    }
    function huxing(){
        $huxingOb = M("M_huxing");
        $harr = $huxingOb->select();
        $this->assign('harr',$harr);
    }
    function demo(){
        $demoOb = M("M_demo");
        $dearr = $demoOb->limit(5)->order('id desc')->select();
        $this->assign('dearr',$dearr);
    }
    function company(){
        $companyOb = M("Gongsi");
        $carr = $companyOb->limit(6)->select();
        $this->assign('carr',$carr);
    }
    function biao(){
        $biaoOb = M("Biao");
        $barr = $biaoOb->limit(5)->select();
        $this->assign('barr',$barr);
    }
    function baike(){
        $baikeOb = M("Baikelist");
        $baike = $baikeOb->limit(4)->select();
        $fid=$baike["bid"];
        $this->assign('baike',$baike);
    }
    function zxwd(){
        $zxwdOb = M("Question");
        $qarr = $zxwdOb->join('right join answer on answer.aid = question.id')->limit(3)->select();
        //var_dump($qarr);
        $this->assign('qarr',$qarr); 
    }
    function city(){
        $this->display();
    }
}